package com.songshuai.webapi.login.client;

import com.songshuai.webapi.login.config.FeignConfig;
import com.songshuai.webapi.login.dto.JWT;
import com.songshuai.webapi.login.hystrix.AuthServiceHystrix;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by yubo on 2018/11/15.
 */

@FeignClient(value = "auth-server",fallback =AuthServiceHystrix.class,configuration = FeignConfig.class)
public interface AuthServiceClient {

    @PostMapping(value = "/oauth/token")
    JWT getToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type,
                 @RequestParam("username") String username, @RequestParam("password") String password);
}



